package com.xltt.vehicleControl.bean;



import java.io.Serializable;

/**
 * @author zhaotengfei
 * @version 1.0.0
 * @created 2017/4/20 17:20
 */

public class DrivingSafetyStatus implements Serializable {
    //车门锁状态
    private static final int DOOR_LOCK_UNKNOWN = 3;
    private static final int DOOR_UNLOCKED = 0;
    private static final int DOOR_LOCKED = 1;
    private static final int DOOR_SAFE_LOCKED = 2;
    //车门打开状态
    private static final int DOOR_OPEN_UNKNOWN = 2;
    private static final int DOOR_OPENED = 1;
    private static final int DOOR_CLOSED = 0;
    //后备箱打开状态
    private static final int TRUNK_OPEN_UNKNOWN = 2;
    private static final int TRUNK_OPENED = 1;
    private static final int TRUNK_CLOSED = 0;
    //引擎盖状态
    private static final int ENGINE_HOOD_CLOSED = 0;
    private static final int ENGINE_HOOD_AJAR = 1;
    private static final int ENGINE_HOOD_RESERVED = 2;
    private static final int ENGINE_HOOD_INVALID = 3;
    //驻车标志状态
    private static final int PARKBRAKE_RELEASED = 0;
    private static final int PARKBRAKE_CLOSED = 1;
    private static final int PARKBRAKE_IN_PROGRESS = 2;
    //后备箱使能状态
    private static final String TRUNK_LOCK_UNLOCK = "0";//使能
    private static final String TRUNK_LOCK_LOCK = "1";//未使能
    //v2私密锁开关状态
    private static final String PRIVATE_LOCK_CLOSE = "0";//关闭
    private static final String PRIVATE_LOCK_OPEN = "1";//开启

    private String srsStatus;
    private Integer vehicleAlarm;
    private Integer doorOpenStatusDriver;
    private Integer doorOpenStatusPassenger;
    private Integer doorOpenStatusDriverRear;
    private Integer doorOpenStatusPassengerRear;
    private Integer doorLockStatusDriver;
    private Integer doorLockStatusPassenger;
    private Integer doorLockStatusDriverRear;
    private Integer doorLockStatusPassengerRear;
    private Integer trunkOpenStatus;
    private String trunkLockStatus;
    private Integer engineHoodOpenStatus;
    private String centralLockingStatus;
    private Boolean seatBeltStatusDriver;
    private Boolean seatBeltStatusPassenger;
    private Boolean seatBeltStatusDriverRear;
    private Boolean seatBeltStatusPassengerRear;
    //驻车标志
    private Integer electricParkBrakeStatus;

    //v2电动门
    private String doorPosDriver;
    private String doorPosPassenger;
    private String doorPosDriverRear;
    private String doorPosPassengerRear;

    //    左前门把手状态
    private String doorGripStatusDriver;
    //    右前门把手状态
    private String doorGripStatusPassenger;
    //    左后门把手状态
    private String doorGripStatusDriverRear;
    //    右后门把手状态
    private String doorGripStatusPassengerRear;

    //加油口盖(0:未知1:开2:关)
    private String tankFlapStatus;
    //引擎盖锁状态
    private String engineHoodLockStatus;

//    第二排驾驶位后面座位的安全带(true: 已系好false:未系)
    private String seatBeltStatusMidRear;
//    第三排驾驶位后面座位的安全带
    private String seatBeltStatusThDriverRear;
//    第三排中间座位的安全带
    private String seatBeltStatusThMidRear;
//    第三排乘客位后面座位的安全带
    private String seatBeltStatusThPassengerRear;
//    安全气囊碰撞状态(0：气囊没有碰撞1：气囊发生碰撞)
    private String srsCrashStatus;
//    中控锁显示状态
    private String centralLockingDisStatus;
    //私密锁状态(0：关 1：开)
    private String privateLockStatus;


    public DrivingSafetyStatus() {
    }

    public boolean isCentralLocked() {
        return this.isDoorAllLockNormal();
    }

    public Integer getElectricParkBrakeStatus() {
        return this.electricParkBrakeStatus;
    }

    public void setElectricParkBrakeStatus(Integer electricParkBrakeStatus) {
        this.electricParkBrakeStatus = electricParkBrakeStatus;
    }

    public String getSrsStatus() {
        return this.srsStatus;
    }

    public void setSrsStatus(String srsStatus) {
        this.srsStatus = srsStatus;
    }

    public Integer getVehicleAlarm() {
        return this.vehicleAlarm;
    }

    public void setVehicleAlarm(Integer vehicleAlarm) {
        this.vehicleAlarm = vehicleAlarm;
    }

    public Integer getDoorOpenStatusDriver() {
        return this.doorOpenStatusDriver;
    }

    public void setDoorOpenStatusDriver(Integer doorOpenStatusDriver) {
        this.doorOpenStatusDriver = doorOpenStatusDriver;
    }

    public Integer getDoorOpenStatusPassenger() {
        return this.doorOpenStatusPassenger;
    }

    public void setDoorOpenStatusPassenger(Integer doorOpenStatusPassenger) {
        this.doorOpenStatusPassenger = doorOpenStatusPassenger;
    }

    public Integer getDoorOpenStatusDriverRear() {
        return this.doorOpenStatusDriverRear;
    }

    public void setDoorOpenStatusDriverRear(Integer doorOpenStatusDriverRear) {
        this.doorOpenStatusDriverRear = doorOpenStatusDriverRear;
    }

    public Integer getDoorOpenStatusPassengerRear() {
        return this.doorOpenStatusPassengerRear;
    }

    public void setDoorOpenStatusPassengerRear(Integer doorOpenStatusPassengerRear) {
        this.doorOpenStatusPassengerRear = doorOpenStatusPassengerRear;
    }

    public Integer getDoorLockStatusDriver() {
        return this.doorLockStatusDriver;
    }

    public void setDoorLockStatusDriver(Integer doorLockStatusDriver) {
        this.doorLockStatusDriver = doorLockStatusDriver;
    }

    public Integer getDoorLockStatusPassenger() {
        return this.doorLockStatusPassenger;
    }

    public void setDoorLockStatusPassenger(Integer doorLockStatusPassenger) {
        this.doorLockStatusPassenger = doorLockStatusPassenger;
    }

    public Integer getDoorLockStatusDriverRear() {
        return this.doorLockStatusDriverRear;
    }

    public void setDoorLockStatusDriverRear(Integer doorLockStatusDriverRear) {
        this.doorLockStatusDriverRear = doorLockStatusDriverRear;
    }

    public Integer getDoorLockStatusPassengerRear() {
        return this.doorLockStatusPassengerRear;
    }

    public void setDoorLockStatusPassengerRear(Integer doorLockStatusPassengerRear) {
        this.doorLockStatusPassengerRear = doorLockStatusPassengerRear;
    }

    public Integer getTrunkOpenStatus() {
        return this.trunkOpenStatus;
    }

    public void setTrunkOpenStatus(Integer trunkOpenStatus) {
        this.trunkOpenStatus = trunkOpenStatus;
    }

    public Integer getEngineHoodOpenStatus() {
        return this.engineHoodOpenStatus;
    }

    public void setEngineHoodOpenStatus(Integer engineHoodOpenStatus) {
        this.engineHoodOpenStatus = engineHoodOpenStatus;
    }

    public String getCentralLockingStatus() {
        return this.centralLockingStatus;
    }

    public void setCentralLockingStatus(String centralLockingStatus) {
        this.centralLockingStatus = centralLockingStatus;
    }

    public Boolean getSeatBeltStatusDriver() {
        return this.seatBeltStatusDriver;
    }

    public void setSeatBeltStatusDriver(Boolean seatBeltStatusDriver) {
        this.seatBeltStatusDriver = seatBeltStatusDriver;
    }

    public Boolean getSeatBeltStatusPassenger() {
        return this.seatBeltStatusPassenger;
    }

    public void setSeatBeltStatusPassenger(Boolean seatBeltStatusPassenger) {
        this.seatBeltStatusPassenger = seatBeltStatusPassenger;
    }

    public Boolean getSeatBeltStatusDriverRear() {
        return this.seatBeltStatusDriverRear;
    }

    public void setSeatBeltStatusDriverRear(Boolean seatBeltStatusDriverRear) {
        this.seatBeltStatusDriverRear = seatBeltStatusDriverRear;
    }

    public Boolean getSeatBeltStatusPassengerRear() {
        return this.seatBeltStatusPassengerRear;
    }

    public void setSeatBeltStatusPassengerRear(Boolean seatBeltStatusPassengerRear) {
        this.seatBeltStatusPassengerRear = seatBeltStatusPassengerRear;
    }

    public String getDoorPosDriver() {
        return doorPosDriver;
    }

    public void setDoorPosDriver(String doorPosDriver) {
        this.doorPosDriver = doorPosDriver;
    }

    public String getDoorPosPassenger() {
        return doorPosPassenger;
    }

    public void setDoorPosPassenger(String doorPosPassenger) {
        this.doorPosPassenger = doorPosPassenger;
    }

    public String getDoorPosDriverRear() {
        return doorPosDriverRear;
    }

    public void setDoorPosDriverRear(String doorPosDriverRear) {
        this.doorPosDriverRear = doorPosDriverRear;
    }

    public String getDoorPosPassengerRear() {
        return doorPosPassengerRear;
    }

    public void setDoorPosPassengerRear(String doorPosPassengerRear) {
        this.doorPosPassengerRear = doorPosPassengerRear;
    }

    public String getTankFlapStatus() {
        return tankFlapStatus;
    }

    public void setTankFlapStatus(String tankFlapStatus) {
        this.tankFlapStatus = tankFlapStatus;
    }

    //    public boolean isDoorDriverOpenNormal() {
//        return this.doorOpenStatusDriver == null || this.doorOpenStatusDriver.intValue() == DOOR_CLOSED;
//    }

    //逻辑是没有确定是打开就是关闭的
    public boolean isDoorDriverCloseNormal() {
        if (XChangeConstant.isLeftRudder)
            return this.doorOpenStatusDriver == null || this.doorOpenStatusDriver.intValue() != DOOR_OPENED;
        else
            return this.doorOpenStatusPassenger == null || this.doorOpenStatusPassenger.intValue() != DOOR_OPENED;
    }


    //逻辑是没有确定是打开就是关闭的
    public boolean isDoorDriverRearCloseNormal() {
        return this.doorOpenStatusDriverRear == null || this.doorOpenStatusDriverRear.intValue() != DOOR_OPENED;
    }


    //逻辑是没有确定是打开就是关闭的
    public boolean isDoorPassengerCloseNormal() {
        if (XChangeConstant.isLeftRudder)
            return this.doorOpenStatusPassenger == null || this.doorOpenStatusPassenger.intValue() != DOOR_OPENED;
        else
            return this.doorOpenStatusDriver == null || this.doorOpenStatusDriver.intValue() != DOOR_OPENED;
    }


    //逻辑是没有确定是打开就是关闭的
    public boolean isDoorPassengerRearCloseNormal() {
        return this.doorOpenStatusPassengerRear == null || this.doorOpenStatusPassengerRear.intValue() != DOOR_OPENED;
    }

    //逻辑是没有确定是打开就是关闭的
    public boolean isDoorAllCloseNormal() {
        return this.isDoorDriverCloseNormal() && this.isDoorDriverRearCloseNormal() && this
                .isDoorPassengerCloseNormal() && this.isDoorPassengerRearCloseNormal();
    }

//    public boolean isDoorAllOpenNormal() {
//        return this.isDoorDriverOpenNormal() && this.isDoorDriverRearOpenNormal() && this
//                .isDoorPassengerOpenNormal() && this.isDoorPassengerRearOpenNormal();
//    }

    public boolean isDoorAllLockNormal() {
        return this.isDoorDriverLockNormal() && this.isDoorDriverRearLockNormal() && this
                .isDoorPassengerLockNormal() && this.isDoorPassengerRearLockNormal();
    }

    public boolean isDoorDriverLockNormal() {
        if (XChangeConstant.isLeftRudder)
            return this.doorLockStatusDriver == null || this.doorLockStatusDriver.intValue() == DOOR_LOCKED;
        else
            return this.doorLockStatusPassenger == null || this.doorLockStatusPassenger.intValue() == DOOR_LOCKED;
    }

    public boolean isDoorDriverRearLockNormal() {
        return this.doorLockStatusDriverRear == null || this.doorLockStatusDriverRear.intValue() == DOOR_LOCKED;
    }

    public boolean isDoorPassengerLockNormal() {
        if (XChangeConstant.isLeftRudder)
            return this.doorLockStatusPassenger == null || this.doorLockStatusPassenger.intValue() == DOOR_LOCKED;
        else
            return this.doorLockStatusDriver == null || this.doorLockStatusDriver.intValue() == DOOR_LOCKED;
    }

    public boolean isDoorPassengerRearLockNormal() {
        return this.doorLockStatusPassengerRear == null || this.doorLockStatusPassengerRear.intValue() == DOOR_LOCKED;
    }

    public boolean isEngineHoodNormal() {
        return this.engineHoodOpenStatus == null || this.engineHoodOpenStatus.intValue() == ENGINE_HOOD_CLOSED;
    }

    public boolean isTrunkNormal() {
        return this.trunkOpenStatus == null || this.trunkOpenStatus.intValue() == TRUNK_CLOSED;
    }

    public boolean isBrakeNormal() {
        return this.electricParkBrakeStatus == null || this.electricParkBrakeStatus.intValue() != PARKBRAKE_CLOSED;
    }

    public boolean isTrunkLockNormal() {
        return this.trunkLockStatus != null && TRUNK_LOCK_LOCK.equals(this.trunkLockStatus);
    }

    public String getTrunkLockStatus() {
        return trunkLockStatus;
    }

    public void setTrunkLockStatus(String trunkLockStatus) {
        this.trunkLockStatus = trunkLockStatus;
    }

    public String getEngineHoodLockStatus() {
        return engineHoodLockStatus;
    }

    public void setEngineHoodLockStatus(String engineHoodLockStatus) {
        this.engineHoodLockStatus = engineHoodLockStatus;
    }

    public String getDoorGripStatusDriver() {
        return doorGripStatusDriver;
    }

    public void setDoorGripStatusDriver(String doorGripStatusDriver) {
        this.doorGripStatusDriver = doorGripStatusDriver;
    }

    public String getDoorGripStatusPassenger() {
        return doorGripStatusPassenger;
    }

    public void setDoorGripStatusPassenger(String doorGripStatusPassenger) {
        this.doorGripStatusPassenger = doorGripStatusPassenger;
    }

    public String getDoorGripStatusDriverRear() {
        return doorGripStatusDriverRear;
    }

    public void setDoorGripStatusDriverRear(String doorGripStatusDriverRear) {
        this.doorGripStatusDriverRear = doorGripStatusDriverRear;
    }

    public String getDoorGripStatusPassengerRear() {
        return doorGripStatusPassengerRear;
    }

    public void setDoorGripStatusPassengerRear(String doorGripStatusPassengerRear) {
        this.doorGripStatusPassengerRear = doorGripStatusPassengerRear;
    }

    public String getSeatBeltStatusMidRear() {
        return seatBeltStatusMidRear;
    }

    public void setSeatBeltStatusMidRear(String seatBeltStatusMidRear) {
        this.seatBeltStatusMidRear = seatBeltStatusMidRear;
    }

    public String getSeatBeltStatusThDriverRear() {
        return seatBeltStatusThDriverRear;
    }

    public void setSeatBeltStatusThDriverRear(String seatBeltStatusThDriverRear) {
        this.seatBeltStatusThDriverRear = seatBeltStatusThDriverRear;
    }

    public String getSeatBeltStatusThMidRear() {
        return seatBeltStatusThMidRear;
    }

    public void setSeatBeltStatusThMidRear(String seatBeltStatusThMidRear) {
        this.seatBeltStatusThMidRear = seatBeltStatusThMidRear;
    }

    public String getSeatBeltStatusThPassengerRear() {
        return seatBeltStatusThPassengerRear;
    }

    public void setSeatBeltStatusThPassengerRear(String seatBeltStatusThPassengerRear) {
        this.seatBeltStatusThPassengerRear = seatBeltStatusThPassengerRear;
    }

    public String getSrsCrashStatus() {
        return srsCrashStatus;
    }

    public void setSrsCrashStatus(String srsCrashStatus) {
        this.srsCrashStatus = srsCrashStatus;
    }

    public String getCentralLockingDisStatus() {
        return centralLockingDisStatus;
    }

    public void setCentralLockingDisStatus(String centralLockingDisStatus) {
        this.centralLockingDisStatus = centralLockingDisStatus;
    }

    public String getPrivateLockStatus() {
        return privateLockStatus;
    }

    public void setPrivateLockStatus(String privateLockStatus) {
        this.privateLockStatus = privateLockStatus;
    }

    public boolean isPrivateOpen() {
        return this.privateLockStatus == null || this.privateLockStatus.equals( PRIVATE_LOCK_OPEN);
    }
}
